package com.athuiju.fenxiaoback.entity;

import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import java.util.List;

import com.baomidou.mybatisplus.annotation.TableLogic;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 
 * </p>
 *
 * @author athuiju
 * @since 2021-07-02
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="TbCartitem对象", description="")
public class TbCartitem implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "对应的sku")
    @TableField("skuId")
    private String skuId;

    @ApiModelProperty(value = "对应的购物车id")
    private Long cartid;

    @ApiModelProperty(value = "是否被选中，1是，0否")
    private Boolean isCheck;

    @ApiModelProperty(value = "sku标题")
    private String title;

    @ApiModelProperty(value = "购物项图片")
    private String image;

    @ApiModelProperty(value = "单价")
    private BigDecimal price;

    @ApiModelProperty(value = "数量")
    @TableField("`count`")
    private Integer count;

    @ApiModelProperty(value = "总价")
    @TableField("totalPrice")
    private BigDecimal totalPrice;

    @ApiModelProperty(value = "sku销售属性集合 eg:")
    @TableField(exist = false)
    private List<String> skuAttr;

    @ApiModelProperty(value = "会员id")
    private Long memberid;

    @ApiModelProperty(value = "留言")
    private String notes;


    @ApiModelProperty(value = "店铺名字")
    private String storeName;

    public String getSkuId() {
        return skuId;
    }

    public void setSkuId(String skuId) {
        this.skuId = skuId;
    }

    public Boolean getCheck() {
        return isCheck;
    }

    public void setCheck(Boolean check) {
        this.isCheck = check;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getImage() {
        return image;
    }

    public void setImage(String image) {
        this.image = image;
    }

    public List<String> getSkuAttr() {
        return skuAttr;
    }

    public void setSkuAttr(List<String> skuAttr) {
        this.skuAttr = skuAttr;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public Integer getCount() {
        return count;
    }

    public void setCount(Integer count) {
        this.count = count;
    }

    /**
     * 手动计算总价
     */
    public BigDecimal getTotalPrice() {
        return this.price.multiply(new BigDecimal(this.count));
    }

    public void setTotalPrice(BigDecimal totalPrice) {
        this.totalPrice = totalPrice;
    }

}
